package com.one.consumer.reserve.presenter;

import android.content.Context;

import com.one.common.model.http.callback.ObserverOnResultListener;
import com.one.common.presenter.BaseApiPresenter;
import com.one.common.view.base.BaseActivity;
import com.one.common.view.base.IListView;
import com.one.consumer.reserve.model.ReserveModel;
import com.one.consumer.reserve.model.item.AreaItem;

import java.util.ArrayList;

/**
 * author ：zhulunjun
 * email  ：zhulunjun@qq.com
 * date   ：2018/10/30 10:27 PM
 * description ：
 **/
public class SelectAreaPresenter extends BaseApiPresenter<IListView, ReserveModel> {

    public SelectAreaPresenter(IListView mView, Context mContext) {
        super(mView, mContext, new ReserveModel((BaseActivity) mContext));
    }

    /**
     * 获取区域
     */
    public void getAreaList(String id){
        mModel.getAreaList(id, new ObserverOnResultListener<ArrayList<AreaItem>>() {
            @Override
            public void onResult(ArrayList<AreaItem> areaItems) {
                if(mView!=null){
                    mView.loadSuccess(areaItems);
                }
            }
        });
    }
}
